package club.beimeng.demos.demo2021年5月18日;


import java.io.*;
import java.lang.*;

class Four{
    public static void main(String[] args) throws Exception{
        BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.valueOf(buf.readLine());
        while(n -- != 0){
            int x = Integer.valueOf(buf.readLine());
            if(x == 1){
                System.out.println("No");
                continue;
            }
            boolean flag = false;
            for(int i = 2; i <= x / i; ++i){
                if(x % i == 0){
                    flag = true;
                    break;
                }
            }
            if(flag){
                System.out.println("No");
            }else{
                System.out.println("Yes");
            }
        }

    }
}

/*
 *
 * @author Mr.Bao
 * @date
 */